package entity;

/*
返回消息实体类
 */
public class Result {
    private Boolean flag;//结果
    private String message;//信息
    private int code;//状态码
    private  Object data;//数据

    /*
    不同形式返回结果的构造函数
     */
    public Result() {
    }

    public Result(Boolean flag, String message, int code) {
        this.flag = flag;
        this.message = message;
        this.code = code;
    }

    public Result(Boolean flag, String message, int code, Object data) {
        this.flag = flag;
        this.message = message;
        this.code = code;
        this.data = data;
    }
/*
    getter setter 方法
 */
    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "flag=" + flag +
                ", message='" + message + '\'' +
                ", code=" + code +
                ", data=" + data +
                '}';
    }
}
